import Vue from 'vue';
import Vuex from 'vuex';
// 引入axios组件
import axios from 'axios';
import qs from 'qs';
// 处理数据  qs.stringify(params)
// inport 引入 其余组件部分的VUEX
import admin_store from './views/admin/admin_store.js';
// 引入某个store对象
import bak_store from './views/bak/bak_store.js';
// 引入某个store对象
import index_store from './views/index/index_store.js';
// 引入某个store对象
import article_store from './views/article/article_store.js';
// 引入某个store对象
import product_store from './views/product/product_store.js';
// 引入某个store对象
import label_store from './views/label/label_store.js';
// 引入某个store对象
import friendlink_store from './views/friendlink/friendlink_store.js';
// 引入某个store对象
import gossip_store from './views/gossip/gossip_store.js';
// 引入某个store对象
import notice_store from './views/notice/notice_store.js';
// 引入某个store对象
import message_store from './views/message/message_store.js';
// 引入某个store对象
import comment_store from './views/comment/comment_store.js';
// 引入某个store对象
import user_store from './views/user/user_store.js';
// 引入某个store对象
import resource_store from './views/resource/resource_store.js';

Vue.use(Vuex);// 引入某个store对象

export default new Vuex.Store({
  state: {
    websiteinfo: '',
    loginstatus: '',
    waterInfo: '',
  },
  mutations: {
    // 获取网站设置信息
    getwebsiteinfo(state, websiteinfo) {
      // console.log(websiteinfo);
      state.websiteinfo = websiteinfo;
    },
    // 获取水印设置信息
    getWaterInfo(state, waterInfo) {
      state.waterInfo = waterInfo;
    },
    // 修改登录状态
    putloginstatus(state, status) {
      state.loginstatus = status;
    },
  },
  modules: {
    admin: admin_store,
    bak: bak_store,
    index: index_store,
    article: article_store,
    product: product_store,
    label: label_store,
    friendlink: friendlink_store,
    gossip: gossip_store,
    notice: notice_store,
    message: message_store,
    comment: comment_store,
    resource: resource_store,
    user: user_store,
    // other: other,//其他组件
  },
});
